package com.goldgov.code.web;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/notice")
public class NoticeController {

	private String noticeText;
	
	@PostMapping
	public String setNoticeText(@RequestParam("noticeText") String noticeText){
		this.noticeText = noticeText;
		return "SUCCESS";
	}
	
	@GetMapping
	public String getNoticeText(){
		return noticeText == null ? "" : noticeText;
	}
}
